using System;
using System.Diagnostics;
using System.Globalization;

namespace Atomic.Structures
{
	[Serializable]
	public class ConstituentMapping<T>
	{
		public ConstituentMapping(Constituent constituent, T value)
		{
			Constituent = constituent;
			Value = value;
		}

		public Constituent Constituent
		{
			get;
			private set;
		}

		public T Value
		{
			get;
			private set;
		}
	}

	[Serializable]
	[DebuggerDisplay("{DebuggerDisplay}")]
	public class ConstituentMapping : ConstituentMapping<double>
	{
		public ConstituentMapping(Constituent constituent, double value)
			: base(constituent, value)
		{
		}

		private string DebuggerDisplay
		{
			get
			{
				return string.Format(CultureInfo.InvariantCulture, "({0} = {1:f4}) = {2:f4}", Constituent.Atom.Symbol, 1.0, Value);
			}
		}
	}
}
